home *** CD-ROM | disk | FTP | other *** search
- Path: kuhub.cc.ukans.edu!anh
- From: anh@kuhub.cc.ukans.edu
- Newsgroups: comp.lang.c
- Subject: Re: unique id for a string
- Message-ID: <1996Feb22.175728.114586@kuhub.cc.ukans.edu>
- Date: 22 Feb 96 17:57:28 CST
- References: <1996Feb16.175601.114182@kuhub.cc.ukans.edu> <harmon.824680556@pegasus.montclair.edu>
- Organization: University of Kansas Academic Computing Services
-
- In article <harmon.824680556@pegasus.montclair.edu>, harmon@pegasus.montclair.edu (Derek Harmon) writes:
- > anh@kuhub.cc.ukans.edu writes:
- >>This is not a quite a C problem. But since the implementation will be in
- >>C anyway.
- >
- > Then I won't quite give an answer in C. :)
-
- ML, Smalltalk, Prolog, Scheme, Common Lisp, C++, JAVA, Machine Code,
- Pascal, Perl, Shell script, Awk script, work fine too. :-)
-
- The reason I though a posting here would yield a good result is that,
- REAL (read best) PROGRAMMERS DO IT IN C. :-)
-
- >>Another way is to simply assign a id to a word and store the word in a
- >>binary search tree, and therefore, it is relatively fast to make sure
- >>each word has an unique id. But I think it is still to slow. We are
- >>talking about a possible 200,000+ words.
-
- > How balanced the tree would be depends on either the order of input, or
- > the tree's self-balancing of itself which makes input longer, but logarith-
- > mically lowers the bound on search time. But we are talking about more than
- > 200,000 words here, and that is where the problem occurs. If the max length
- > of these strings is 32 characters, then we are talking about roughly 7.3 x
- > 10^43 different strings. That will not fit into a 64-bit long. :)
-
- I don't understand the 10^43 number? You must be talking about the
- permutations of strings of 32 characters?
-
- > -- Stone
-
- Anh
-